<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Paired-Single Built-in Functions (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="Paired-Single Built-in Functions (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="Paired-Single Built-in Functions (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="MIPS-Loongson-Built_002din-Functions.html" rel="up" title="MIPS Loongson Built-in Functions">
<link href="MIPS_002d3D-Built_002din-Functions.html" rel="next" title="MIPS-3D Built-in Functions">
<link href="Paired_002dSingle-Arithmetic.html" rel="prev" title="Paired-Single Arithmetic">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
kbd.key {font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="subsubsection-level-extent" id="Paired_002dSingle-Built_002din-Functions">
<div class="nav-panel">
<p>
Next: <a href="MIPS_002d3D-Built_002din-Functions.html" accesskey="n" rel="next">MIPS-3D Built-in Functions</a>, Previous: <a href="Paired_002dSingle-Arithmetic.html" accesskey="p" rel="prev">Paired-Single Arithmetic</a>, Up: <a href="MIPS-Loongson-Built_002din-Functions.html" accesskey="u" rel="up">MIPS Loongson Built-in Functions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsubsection" id="Paired_002dSingle-Built_002din-Functions-1"><span>6.60.17.2 Paired-Single Built-in Functions<a class="copiable-link" href="#Paired_002dSingle-Built_002din-Functions-1"> &para;</a></span></h4>

<p>The following paired-single functions map directly to a particular
MIPS instruction.  Please refer to the architecture specification
for details on what each instruction does.
</p>
<dl class="table">
<dt><code class="code">v2sf __builtin_mips_pll_ps (v2sf, v2sf)</code></dt>
<dd><p>Pair lower lower (<code class="code">pll.ps</code>).
</p>
</dd>
<dt><code class="code">v2sf __builtin_mips_pul_ps (v2sf, v2sf)</code></dt>
<dd><p>Pair upper lower (<code class="code">pul.ps</code>).
</p>
</dd>
<dt><code class="code">v2sf __builtin_mips_plu_ps (v2sf, v2sf)</code></dt>
<dd><p>Pair lower upper (<code class="code">plu.ps</code>).
</p>
</dd>
<dt><code class="code">v2sf __builtin_mips_puu_ps (v2sf, v2sf)</code></dt>
<dd><p>Pair upper upper (<code class="code">puu.ps</code>).
</p>
</dd>
<dt><code class="code">v2sf __builtin_mips_cvt_ps_s (float, float)</code></dt>
<dd><p>Convert pair to paired single (<code class="code">cvt.ps.s</code>).
</p>
</dd>
<dt><code class="code">float __builtin_mips_cvt_s_pl (v2sf)</code></dt>
<dd><p>Convert pair lower to single (<code class="code">cvt.s.pl</code>).
</p>
</dd>
<dt><code class="code">float __builtin_mips_cvt_s_pu (v2sf)</code></dt>
<dd><p>Convert pair upper to single (<code class="code">cvt.s.pu</code>).
</p>
</dd>
<dt><code class="code">v2sf __builtin_mips_abs_ps (v2sf)</code></dt>
<dd><p>Absolute value (<code class="code">abs.ps</code>).
</p>
</dd>
<dt><code class="code">v2sf __builtin_mips_alnv_ps (v2sf, v2sf, int)</code></dt>
<dd><p>Align variable (<code class="code">alnv.ps</code>).
</p>
<p><em class="emph">Note:</em> The value of the third parameter must be 0 or 4
modulo 8, otherwise the result is unpredictable.  Please read the
instruction description for details.
</p></dd>
</dl>

<p>The following multi-instruction functions are also available.
In each case, <var class="var">cond</var> can be any of the 16 floating-point conditions:
<code class="code">f</code>, <code class="code">un</code>, <code class="code">eq</code>, <code class="code">ueq</code>, <code class="code">olt</code>, <code class="code">ult</code>,
<code class="code">ole</code>, <code class="code">ule</code>, <code class="code">sf</code>, <code class="code">ngle</code>, <code class="code">seq</code>, <code class="code">ngl</code>,
<code class="code">lt</code>, <code class="code">nge</code>, <code class="code">le</code> or <code class="code">ngt</code>.
</p>
<dl class="table">
<dt><code class="code">v2sf __builtin_mips_movt_c_<var class="var">cond</var>_ps (v2sf <var class="var">a</var>, v2sf <var class="var">b</var>, v2sf <var class="var">c</var>, v2sf <var class="var">d</var>)</code></dt>
<dt><code class="code">v2sf __builtin_mips_movf_c_<var class="var">cond</var>_ps (v2sf <var class="var">a</var>, v2sf <var class="var">b</var>, v2sf <var class="var">c</var>, v2sf <var class="var">d</var>)</code></dt>
<dd><p>Conditional move based on floating-point comparison (<code class="code">c.<var class="var">cond</var>.ps</code>,
<code class="code">movt.ps</code>/<code class="code">movf.ps</code>).
</p>
<p>The <code class="code">movt</code> functions return the value <var class="var">x</var> computed by:
</p>
<div class="example smallexample">
<pre class="example-preformatted">c.<var class="var">cond</var>.ps <var class="var">cc</var>,<var class="var">a</var>,<var class="var">b</var>
mov.ps <var class="var">x</var>,<var class="var">c</var>
movt.ps <var class="var">x</var>,<var class="var">d</var>,<var class="var">cc</var>
</pre></div>

<p>The <code class="code">movf</code> functions are similar but use <code class="code">movf.ps</code> instead
of <code class="code">movt.ps</code>.
</p>
</dd>
<dt><code class="code">int __builtin_mips_upper_c_<var class="var">cond</var>_ps (v2sf <var class="var">a</var>, v2sf <var class="var">b</var>)</code></dt>
<dt><code class="code">int __builtin_mips_lower_c_<var class="var">cond</var>_ps (v2sf <var class="var">a</var>, v2sf <var class="var">b</var>)</code></dt>
<dd><p>Comparison of two paired-single values (<code class="code">c.<var class="var">cond</var>.ps</code>,
<code class="code">bc1t</code>/<code class="code">bc1f</code>).
</p>
<p>These functions compare <var class="var">a</var> and <var class="var">b</var> using <code class="code">c.<var class="var">cond</var>.ps</code>
and return either the upper or lower half of the result.  For example:
</p>
<div class="example smallexample">
<pre class="example-preformatted">v2sf a, b;
if (__builtin_mips_upper_c_eq_ps (a, b))
  upper_halves_are_equal ();
else
  upper_halves_are_unequal ();

if (__builtin_mips_lower_c_eq_ps (a, b))
  lower_halves_are_equal ();
else
  lower_halves_are_unequal ();
</pre></div>
</dd>
</dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="MIPS_002d3D-Built_002din-Functions.html">MIPS-3D Built-in Functions</a>, Previous: <a href="Paired_002dSingle-Arithmetic.html">Paired-Single Arithmetic</a>, Up: <a href="MIPS-Loongson-Built_002din-Functions.html">MIPS Loongson Built-in Functions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
